<?php
    if(isset($this->_aVars["aFeed"])){
        $aFeed = $this->_aVars["aFeed"];
        
        $sTweet = isset($aFeed["feed_status"]) ? $aFeed["feed_status"] : "";
        if(!empty($sTweet)){
            $aMatchs = array();

            preg_match_all("/(#\w+)/", $sTweet, $aMatchs); 
            
            if(!empty($aMatchs) && is_array($aMatchs)){
                foreach($aMatchs as $aMatch){
                    if(is_array($aMatch)){
                        foreach($aMatch as $sMatch){
                            $sLink = '<a href="#" class="hashtags" onclick="$(\'#header_sub_menu_search_input\').val(\''.substr($sMatch,1).'\');$(\'#header_search_form\').submit();">'.substr($sMatch,1).'</a>';
                            $sTweet = str_replace($sMatch,$sLink,$sTweet);
                        }
                    }
                }
                $this->_aVars["aFeed"]["feed_status"] = $sTweet;
            }
        }
    }
?>